﻿using Axis.Web.Views.Global;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using Axis.BusinessObject.Core;

namespace Axis.Web.Views.Accounts.Service
{
    /// <summary>
    /// Summary description for UpdateMember
    /// </summary>
    public class UpdateMember : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.Write(Update(context));
        }
        protected string Update(HttpContext context)
        {
            CMemberCore memberCore = new CMemberCore();
            string inputValue = memberCore.GetMemberInputValue(context);
            /* Action */
             CMemberList member = new CMemberList();
            if (context.Session["MEMBERINFO"] != null)
               member= context.Session["MEMBERINFO"] as CMemberList ;
            var member2 = new CMemberList();
            string result = new AccountUI().UpdateMember(inputValue, member, out member2);
            context.Session["MEMBERINFO"] = member2;
            return result;

        }
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}